package com.wz.jiangsu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: wz
 * @author: wangzhou
 * @create: 2024-09-10 14:18
 * @description:
 **/
@RestController
@RequestMapping("/test")
public class TestFlameController {

    @GetMapping("/flame")
    public String test() throws Exception{

        String str = fun1(2);
        System.out.println(str);

        Integer num = fun2("aaa");
        System.out.println("num = " + num);
        return "hello";
    }


    private static String fun1(int i) throws InterruptedException {

        boolean flag = true;

        while (flag){
            Thread.sleep(7 * 1000);
            flag = false;
        }


        return "hell0";
    }

    private static Integer fun2(String str ) throws InterruptedException {

        boolean flag = true;

        while (flag){
            Thread.sleep(8 * 1000);
            flag = false;
        }

        return 2;
    }
}
